/*


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v1

import (
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// EDIT THIS FILE!  THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required.  Any new fields you add must have json tags for the fields to be serialized.

// CmdbhandleSpec defines the desired state of Cmdbhandle
type CmdbhandleSpec struct {
	// INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
	// Important: Run "make" to regenerate code after modifying this file

	// Foo is an example field of Cmdbhandle. Edit Cmdbhandle_types.go to remove/update

	K8s_name               string `json:"k8s_name,omitempty"`
	K8s_type               string `json:"k8s_type,omitempty"`
	K8s_kong_ip            string `json:"k8s_kong_ip,omitempty"`
	K8s_upstream           string `json:"k8s_upstream,omitempty"`
	K8s_jar                string `json:"k8s_jar,omitempty"`
	K8s_start              string `json:"k8s_start,omitempty"`
	K8s_check              string `json:"k8s_check,omitempty"`
	K8s_port               *int32 `json:"k8s_port,omitempty"`
	K8s_deployment         string `json:"k8s_deployment,omitempty"`
	K8s_svc                string `json:"k8s_svc,omitempty"`
	K8s_hpa                string `json:"k8s_hpa,omitempty"`
	K8s_remarks            string `json:"k8s_remarks,omitempty"`
	K8s_version            string `json:"k8s_version,omitempty"`
	K8s_git                string `json:"k8s_git,omitempty"`
	K8s_git_branch         string `json:"k8s_git_branch,omitempty"`
	K8s_git_jar_path       string `json:"k8s_git_jar_path,omitempty"`
	K8s_signtime           string `json:"k8s_signtime,omitempty"`
	K8s_branch_type_master string `json:"k8s_branch_type_master,omitempty"`
	K8s_branch_type_test   string `json:"k8s_branch_type_test,omitempty"`
	K8s_log                string `json:"k8s_log,omitempty"`
	K8s_project_type       string `json:"k8s_project_type,omitempty"`
	Deploy_Config          string `json:"deploy_Config,omitempty"`
	Deploy_type            string `json:"deploy_type,omitempty"`
	Deploy_env             string `json:"deploy_env,omitempty"`
	Xms                    string `json:"xms,omitempty"`
	Xmx                    string `json:"xmx,omitempty"`
	Args                   string `json:"args,omitempty"`
	Image                  string `json:"image"`
}
type CheckStatus struct {
	Pending          []string `json:"Pending,omitempty"`
	Running_yes      []string `json:"Running_yes,omitempty"`
	Running_no       []string `json:"Running_no,omitempty"`
	CrashLoopBackOff []string `json:"CrashLoopBackOff,omitempty"`
}

// CmdbhandleStatus defines the observed state of Cmdbhandle
type CmdbhandleStatus struct {
	// INSERT ADDITIONAL STATUS FIELD - define observed state of cluster
	// Important: Run "make" to regenerate code after modifying this file
	// AvailableReplicas string `json:"AvailableReplicas,omitempty"`
	CheckStatus  CheckStatus `json:"CheckStatus,omitempty"`
	UpdateStatus string      `json:"UpdateStatus,omitempty"`
}

// +kubebuilder:object:root=true

// Cmdbhandle is the Schema for the cmdbhandles API
type Cmdbhandle struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CmdbhandleSpec   `json:"spec,omitempty"`
	Status CmdbhandleStatus `json:"status,omitempty"`
}

// +kubebuilder:object:root=true

// CmdbhandleList contains a list of Cmdbhandle
type CmdbhandleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Cmdbhandle `json:"items"`
}

func init() {
	SchemeBuilder.Register(&Cmdbhandle{}, &CmdbhandleList{})
}
